//
// Created by 成飞 on 2024/1/4.
//

#ifndef ORDERKV_LSM_TREE_H
#define ORDERKV_LSM_TREE_H

#include <string>
#include <vector>
#include <map>
#include "RecordVal.h"

namespace lsm{
    using std::vector;
    using std::string;
    using std::string_view;
    using std::pair;
    using std::array;

    class LsmTree{
    public:
        virtual bool put(std::string_view key, std::string_view val) = 0;

        virtual bool batch_put(const std::vector<std::pair<std::string_view, std::string_view>> &kvPairBatch) = 0;

        virtual bool query(std::string_view key, std::string& ret) = 0;

        virtual bool range_query(const string &startKey, const string &endKey, int len, vector<pair<string , lsm::LsmRecordVal>>& valLocations, array<lsm::ScanInfo*, FILE_NO_MAX>& scanIndex) = 0;

        virtual bool range_query2(const std::string &startKey, const std::string &endKey, int len, std::vector<std::pair<std::string , std::string>>& ret) = 0;
//
//    virtual bool remove(const std::string &key) = 0;

        virtual void snapshot() = 0;
//
        virtual void release_snapshot() = 0;
    };
}

#endif //ORDERKV_LSM_TREE_H
